<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Dog(name , age){
            this.name = name;
            this.age = age;

        }
            Dog.prototype.cry = function(){
                console.log(this.name+'狗叫一次');
            }
        let dog1 = new Dog('小吴','20');
        let dog2 = new Dog('吴志龙','19');

        console.log(dog1,dog2);
        setInterval(()=>{
            dog2.cry();
       },2000)






    </script>
</body>
</html>